#pragma once
#include "libglew/glew.h"

#ifdef WIN32
#include <GL/glut.h>
#endif
#ifdef __APPLE__
#include <GLUT/glut.h>
// set MAC_TIGER for FCOLLADA
#define MAC_TIGER
#endif
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include "FCollada.h"
#include "FCDocument/FCDocument.h"
#include "FCDocument/FCDAsset.h"
#include "FCDocument/FCDLibrary.h"
#include "FCDocument/FCDGeometry.h"
#include "FCDocument/FCDGeometryMesh.h"
#include "FCDocument/FCDGeometryPolygons.h"
#include "FCDocument/FCDGeometryPolygonsTools.h"
#include "FCDocument/FCDGeometrySource.h"
#include "FUtils/FUFileManager.h"
#include "Matrix4x4.h"
#include "ColladaGeometry.h"
#include "ColladaTextureData.h"
#include "ColladaMaterialData.h"
#include "ColladaGLSLShaderData.h"
#include "ConfigSingleton.h"
#include "Box.h"

namespace lib3dw
{
	class ColladaModel
	{
		public:
			ColladaModel(char* modelFilePath);
			ColladaModel(char* modelFilePath, Box newBoundingBox);
			~ColladaModel();	
			void SetRotation(float angle, float x, float y, float z);
			void SetScale(float x, float y, float z);
			void SetTranslation(float x, float y, float z);
			void SetAmbient(float r, float g, float b, float a);
			void SetDiffuse(float r, float g, float b, float a);
			void SetSpecular(float r, float g, float b, float a);
			void SetShininess(float newShininess);
			void SetBoundingBox(Box newBoundingBox);
			const Vector4* GetRotation() const;
			const Vector3* GetScale() const;
			const Vector3* GetTranslation() const;
			const GLfloat* GetAmbient() const;
			const GLfloat* GetDiffuse() const;
			const GLfloat* GetSpecular() const;
			const GLfloat* GetEmission() const;
			const GLfloat GetShininess() const;
			const Box GetBoundingBox() const;
			const std::vector<GLuint>* GetShaderPasses() const;
			void Draw();
			
		private:
			RenderMode renderMode;
			ColladaGeometry* geometry;
			ColladaTextureData* textureData;
			ColladaMaterialData* materialData;
			ColladaGLSLShaderData* glslShaderData;
			Box boundingBox;
			void ArghhhNoConstructorChaining(char* modelFilePath);
	};
}